package com.tencent.wxcloudrun.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import lombok.Data;

/**
 *
 * @TableName comment
 */
@Data
public class Comment implements Serializable {
    /**
     *
     */
    private Integer id;

    /**
     *
     */
    private Integer parent_id;

    /**
     *
     */
    private String post_id;

    /**
     *
     */
    private String author_name;

    /**
     *
     */
    private String userid;

    /**
     *
     */
    private String author_url;

    /**
     *
     */
    private String date;

    /**
     *
     */
    private String content;

    /**
     *
     */
    private String formId;
    /**
     *
     */
    private String openid;


    /**
     *
     */
    private List<Comment> child;

    public Comment(Integer id, Integer parent_id, String post_id, String author_name, String userid, String author_url, String date, String content, String formId, String openid) {
        this.id = id;
        this.parent_id = parent_id;
        this.post_id = post_id;
        this.author_name = author_name;
        this.userid = userid;
        this.author_url = author_url;
        this.date = date;
        this.content = content;
        this.formId = formId;
        this.openid = openid;
    }

    private static final long serialVersionUID = 1L;

    public Comment() {

    }
    public  void  addChild(Comment platform){
        if(child == null){
            child = new ArrayList<>();
        }
        child.add(platform);
    }
}
